import request from '@/utils/request'

export function getCourseByPage(data) {
  return request({
    url: '/info/source_search',
    method: 'post',
    data,
  })
}

export function getCourseById(id) {
  return request({
    url: '/info/source_find',
    method: 'get',
    params: {
      id,
    },
  })
}

export function createAutoCourse(data) {
  return request({
    url: '/info/source_autosource',
    method: 'post',
    data,
  })
}

export function createCourse(data) {
  return request({
    url: '/info/source_save',
    method: 'post',
    data,
  })
}

export function updateCourse(data) {
  return request({
    url: '/info/source_editsave',
    method: 'post',
    data,
  })
}

export function deleteCourse(ids) {
  return request({
    url: `/info/source_del`,
    method: 'post',
    data: {
      ids,
    },
  })
}
